<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
  <base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
<title>设备信息列表</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery-1.9.1.min.js"></script>
<script src="js/zdialog/zDialog.js" type="text/javascript"></script>
<script src="js/zdialog/zDrag.js" type="text/javascript"></script>
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/pagejs.js"></script>
<script type="text/javascript">
function checkBox(obj) {

// 只有当选中的时候才会去掉其他已经勾选的checkbox，所以这里只判断选中的情况
    if (obj.is(":checked")) {
         // 先把所有的checkbox 都设置为不选种
        $('input.mybox').prop('checked', false);
        // 把自己设置为选中
        obj.prop('checked',true);
    }
     
	 setTimeout(function(){
		 
  
   
   var name = $("#Name"+obj.attr("id")).val();
   var labname=$("#labname"+obj.attr("id")).text();//所属实验室名称
   var labid=$("#labname"+obj.attr("id")).val();//所属实验室ID
    parent.$("#repairsname").val(name);
     parent.$("#labid").val(labid);//所属实验室ID
    parent.$("#equipmentid").val(obj.attr("id"));
     parent.$("#labname").val(labname);
     var index = parent.layer.getFrameIndex(window.name);//获取窗口索引
	 parent.layer.close(index);//通过索引关闭该窗口 
	        
	        },1000);
    
   }
    
</script>


</head>


<body>
    <form action="admin/pageEquipment.action" method="post">
	<div class="place">
    <span>位置</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">设备列表信息</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    
    <div class="tools">
    
    	<ul class="toolbar">
    	  <li class="click"><a href="admin/listClass.action"><span><img src="images/t01.png" /></span>添加</a></li>
    	<li class="click">设备编号:<input name="pageing.number" type="text" class="minput"/>所属实验室:<input name="pageing.name" type="text" class="minput"/>
    	设备类别: 
    	<select name="pageing.classes" class="minput">
    	<option value="" >选择</option>
    <s:iterator value="listclass" var="list" status="index">
    <option value="${list.id}" >${list.classname}</option>
    </s:iterator>
    </select>
       <span> 
		<select name="productInfo.typeId"  id="usersId" >
		</select> 
		</span>
    	&nbsp;&nbsp;&nbsp;&nbsp;</li>
    	<input name="" type="submit" class="btn" value="查询"/>
        </ul>
        
        </form>
    <table class="tablelist">
    	<thead>
    	<tr>
        <th>选择</th>
        <th>序号<i class="sort"><img src="images/px.gif" /></i></th>
        <th>设备编号</th>
        <th>实验室名称</th>
        <th>设备类别</th>
        <th>设备名称</th>
        <th>操作</th>
        </tr>
        </thead>
        <tbody>
       <s:iterator value="pageingFinder.dataList" var="equipment" status="index">
        <tr>
        <td><input name="" type="checkbox" onclick="checkBox($(this));" id="${equipment.equipmentid}" value="" /></td>
        <td><s:property value="#index.index+1"/></td>
        <td>${equipment.equipmentid}
        </td>
        <td>
        <s:iterator value="liLaborary" var="list" status="index">
         <s:if test='#list.labid==#equipment.labid'>
		<option value="${list.labid}"selected="selected" id="labname${equipment.equipmentid}">
		${list.labname}</option>
		</s:if>
		</s:iterator>
       <td>
        <s:iterator value="listclass" var="list" status="index">
        <s:if test='#list.id==#equipment.classes'>
		${list.classname}
		</s:if>
		</s:iterator>
        </td>
        <td>
         <input type="hidden" id="Name${equipment.equipmentid}"  value="${equipment.name}">${equipment.name}</td>
      
        </tr> 
        </s:iterator>
        </tbody>
    </table>
    
   <form action="admin/laborarylist.action" id="pageForm">
       <div class="pagin">
    	<div class="message">共<i class="blue">${pageingFinder.rowCount}</i>页记录<i class="blue">当前第${pageingFinder.pageNo}/${pageingFinder.pageCount}</i>页</div>
        <ul class="paginList">
        <s:if test="pageingFinder.pageNo > 1">
        <li class="paginItem"><a href="javascript:first()"><span class="pagepre">首页</span></a></li>
        <li class="paginItem"><a href="javascript:previous()"><span class="pagenxt">上一页</span></a></li>
        </s:if>
         <s:if test="pageingFinder.pageNo < pageingFinder.pageCount">
        <li class="paginItem"><a href="javascript:next()"><span class="pagepre">下一页</span></a></li>
        <li class="paginItem"><a href="javascript:last()"><span class="pagenxt">尾页</span></a></li>
        </s:if>
       <li> 转到第
        <input id="inputPage" name="pageingFinder.pageNo" id="inputPage" type="text" />页
         <input type="hidden" id="hiddenPagge" value="${pageingFinder.pageCount }"/>
        <input name="" type="submit"  class="cancel" value="转" /></li>
        </ul>
    </div>
    </form>
    </div>
</body>

</html>
